Skip to content

Conversation

@dmitshur
Copy link
Member

Fixes #152.

Add tests for RateLimitError.

Refactor populateRate into a more general parseRate.

Here's a sample error returned when hitting the rate limit:

GET https://api.github.com/users/shurcooL: 403 API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.); rate reset in 15m8.193650147s

Fixes #152.

Add tests for RateLimitError.

Refactor populateRate into a more general parseRate.
}
errorResponse := &ErrorResponse{Response: r}
data, err := ioutil.ReadAll(r.Body)
if err == nil && data != nil {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's worth expanding documentation of CheckError to mention both TwoFactorAuthError and RateLimitError error types?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, probably so.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 76866e1. PTAL.

@willnorris
Copy link
Collaborator

rebased onto current master and merged as c3f5683 and 39d7560. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants